package day0725;

public class Test12 {
    static void  change(int[] b){
        for(int i=0;   i< 4-1 ;i++){
            b[i] =b[i]+ b[i+1];
            b[i+1]=b[i]-b[i+1];
            b[i]=b[i]-b[i+1];
        }
        //打印数组最后一个元素(无论数组有多少个元素)
        System.out.println( b[ b.length -1]   );
    }


    public static void main(String[] args) {
        int[]  a={2,6,8,9};
        Test12.change(a);
    }
}
